package com.asj.house.client;

import com.asj.house.config.feign.HouseUserFeignConfig;
import com.asj.house.domain.HouseUser;
import com.asj.house.returns.RespEntity;
import com.asj.house.returns.RespTable;
import com.asj.house.vo.param.LoginParam;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @author asj
 * @version V1.0.0
 * @description: 用户管理 feign调用
 * @date 2021/02/04 09:29
 */
@FeignClient(name = "houseUserFeignClient", url = "${manage.url}", configuration = HouseUserFeignConfig.class)
public interface HouseUserClient {

    /**
     * 后台管理登陆接口
     * @param loginParam
     * @return
     */
    @PostMapping("/house-user/login")
    RespEntity<HouseUser> login(@RequestBody LoginParam loginParam);

    /**
     * 用户列表
     * @param page
     * @param limit
     * @return
     */
    @GetMapping("/house-user/list")
    RespTable<List<HouseUser>> queryAllUser(@RequestParam("page") Integer page,
                                            @RequestParam("limit") Integer limit);

    /**
     * 搜索用户
     * @param page
     * @param limit
     * @param column
     * @param value
     * @return
     */
    @GetMapping("/house-user/list")
    RespTable<List<HouseUser>> searchUser(@RequestParam("page") Integer page,
                                          @RequestParam("limit") Integer limit,
                                          @RequestParam("column") String column,
                                          @RequestParam("value") String value);

    /**
     * 短信验证码
     */
    @GetMapping("/house-user/send")
    RespEntity<Integer> sendSms(@RequestParam("mobile") String mobile);

}
